#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 vagrant
#
# Distributed under terms of the MIT license.

from django.core.management.base import BaseCommand, CommandError, NoArgsCommand
from esr_parser.models import KeywordTask


class Command(BaseCommand):

    def add_arguments(self, parser):
        parser.add_argument('keyword', type=str)

    def handle(self, *args, **options):
        keyword = options.get('keyword')
        KeywordTask.objects.get_or_create(keyword=keyword)

